/// 直播页面主播端
/// END
import 'package:aidou/widgets/live/preview.dart';
import 'package:flutter/material.dart';

// import '../../widgets/live/cameraPush.dart';

class LivePage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _LivePageState();
}

class _LivePageState extends State<LivePage> {
  startPush() {
    print('开始直播');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: <Widget>[
          // LiveCameraPush(),
          LiveCameraPreview(),
          LivePreview(
            onStartPush: startPush,
          ),
        ],
      ),
    );
  }

  // 摄像头推流预览
  Widget LiveCameraPreview() {
    return Container(
      width: double.infinity,
      height: double.infinity,
      color: Colors.black,
      child: Center(
        child: Text(
          '直播推流',
          style: TextStyle(color: Colors.white),
        ),
      ),
    );
  }

  // 直播设置
  // Widget _LiveSetting() {
  // }

  @override
  void deactivate() {
    print('deactivate');
    super.deactivate();
  }

  @override
  void dispose() {
    print('dispose');
    super.dispose();
  }
}
